package 二叉树;

public class Solution5 {
    //https://www.nowcoder.com/practice/8a2b2bf6c19b4f23a9bdb9b233eefa73
    public int maxDepth (TreeNode root) {
        if (root == null) {
            return 0;
        }
        int left = maxDepth(root.left);
        int right = maxDepth(root.right);
        return left > right ? left + 1 : right + 1;
    }
}
